﻿/**
 * 
 * @file   FITKAbaConnectorAssignment.cpp
 * @brief  连接器界面赋予类
 * @author LiJin (1003680421@qq.com)
 * @date   2024-06-20
 * 
 */
#include "FITKAbaConnectorAssignment.h"
#include "FITKAbaConnectorSection.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"


QString Interface::FITKAbaConnectorAssignment::getSectionType()
{
    auto sec = this->getTSectionObj<FITKAbaConnectorSection>();
    if (sec == nullptr)
        return QString();
    return sec->getTypeString();
}

bool Interface::FITKAbaConnectorAssignment::copy(FITKAbstractDataObject* obj)
{
    bool ok = FITKSectionAssign::copy(obj);
    if (!ok)
        return false;
    FITKAbaConnectorAssignment* a = dynamic_cast<FITKAbaConnectorAssignment*>(obj);
    if (a == nullptr)
        return false;
    m_csysId1 = a->m_csysId1;
    m_csysId2 = a->m_csysId2;
    return true;
}

Core::FITKAbstractDataObject *Interface::FITKAbaConnectorAssignment::getSectionObj()
{
    return FITKDATAREPO->getTDataByID<FITKAbaConnectorSection>(_sectionID);
}


namespace Interface {
int FITKAbaConnectorAssignment::getCsysId1() const
{
    return m_csysId1;
}

void FITKAbaConnectorAssignment::setCsysId1(int newCsysId1)
{
    m_csysId1 = newCsysId1;
}

int FITKAbaConnectorAssignment::getCsysId2() const
{
    return m_csysId2;
}

void FITKAbaConnectorAssignment::setCsysId2(int newCsysId2)
{
    m_csysId2 = newCsysId2;
}

}
